1
0

Compare commits

...

10 Commits

27 changed files with 321 additions and 661 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
result

View File

@ -1,22 +0,0 @@
#!/bin/sh -e
VERSION=1.0
export args=$@
# Navigate to the directory of this script
cd $(dirname $(readlink -f $0))
cd ..
SYSTEM=$(uname)
build() {
if [ $SYSTEM == "Darwin" ]; then
./bin/darwin-build $args
elif [ $SYSTEM == "Linux" ]; then
./bin/nixos-build $args
else
echo "Unknown platform"
fi
}
build

View File

@ -1,27 +0,0 @@
#!/bin/sh -e
VERSION=1.0
GREEN='\033[1;32m'
RED='\033[1;31m'
NC='\033[0m'
FLAKE="macos"
SYSTEM="darwinConfigurations.$FLAKE.system"
export NIXPKGS_ALLOW_UNFREE=1
# Navigate to the directory of this script
cd $(dirname $(readlink -f $0))
cd ..
echo "${GREEN}Starting build...${NC}"
nix --experimental-features 'nix-command flakes' build .#$SYSTEM $@
echo "${GREEN}Switching to new generation...${NC}"
./result/sw/bin/darwin-rebuild switch --flake .#$FLAKE $@
echo "${GREEN}Cleaning up...${NC}"
unlink ./result
echo "${GREEN}Switch to new generation complete!${NC}"

View File

@ -1,29 +0,0 @@
#!/bin/sh -e
VERSION=1.0
GREEN='\033[1;32m'
RED='\033[1;31m'
NC='\033[0m'
SYSTEM=$(uname -m)
case "$SYSTEM" in
x86_64)
FLAKE_TARGET="x86_64-linux"
;;
aarch64)
FLAKE_TARGET="aarch64-linux"
;;
*)
echo -e "${RED}Unsupported architecture: $SYSTEM${NC}"
exit 1
;;
esac
echo -e "${GREEN}Starting...${NC}"
# We pass SSH from user to root so root can download secrets from your private Github
sudo SSH_AUTH_SOCK=$SSH_AUTH_SOCK /run/current-system/sw/bin/nixos-rebuild switch --flake .#$FLAKE_TARGET $@
echo -e "${GREEN}Switch to new generation complete!${NC}"

View File

@ -1,11 +0,0 @@
## Layout
```
.
├── dock # MacOS dock configuration
├── casks.nix # List of homebrew casks
├── default.nix # Defines module, system-level config
├── files.nix # Non-Nix, static configuration files (now immutable!)
├── home-manager.nix # Defines user programs
├── packages.nix # List of packages to install for MacOS
```

View File

@ -1,5 +1,4 @@
{}:
[
# Development Tools
"docker"
@ -7,15 +6,12 @@
"qflipper"
"sublime-merge"
"vscodium"
"warp"
"zed"
# Communication Tools
"discord"
"beeper"
"zoom"
"zulip"
"signal"
"microsoft-teams"
# Utility Tools
"calibre"
@ -23,9 +19,8 @@
"skim"
# Productivity Tools
"alfred"
"raycast"
"mactex-no-gui"
"raycast"
# Browsers
"arc"

View File

@ -1,7 +1,4 @@
{ config, pkgs, ... }:
let user = "dekker1"; in
{ pkgs, user, ... }:
{
imports = [
./home-manager.nix
@ -9,12 +6,9 @@ let user = "dekker1"; in
../shared/cachix
];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# Setup user, packages, programs
nix = {
package = pkgs.nixUnstable;
package = pkgs.nix;
settings.trusted-users = [ "@admin" "${user}" ];
gc = {
@ -34,19 +28,119 @@ let user = "dekker1"; in
system.checks.verifyNixPath = false;
# Load configuration that is shared across systems
environment.systemPackages = with pkgs; [
] ++ (import ../shared/packages.nix { inherit pkgs; });
environment.systemPackages = import ../shared/packages.nix { inherit pkgs; } ++ [
# MacOS specific packages
];
fonts.packages = import ../shared/fonts.nix { inherit pkgs; };
# Setup MacOS specific services
services = {
yabai = {
aerospace = {
enable = true;
extraConfig = (builtins.readFile ./config/yabairc);
settings = {
mode.main.binding = {
# Open a new terminal window
alt-enter = "exec-and-forget /Users/dekker1/.nix-profile/bin/kitty --single-instance -d ~";
# alt-enter = "exec-and-forget open \"warp://action/new_window?path=$HOME\"";
# Toggle between floating and tiling layout
alt-shift-space = "layout floating tiling";
### Key mappings copied from the default config
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-slash = "layout tiles horizontal vertical";
alt-comma = "layout accordion horizontal vertical";
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = "focus left";
alt-j = "focus down";
alt-k = "focus up";
alt-l = "focus right";
# See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = "move left";
alt-shift-j = "move down";
alt-shift-k = "move up";
alt-shift-l = "move right";
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-shift-minus = "resize smart -50";
alt-shift-equal = "resize smart +50";
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-1 = "workspace 1";
alt-2 = "workspace 2";
alt-3 = "workspace 3";
alt-4 = "workspace 4";
alt-5 = "workspace 5";
alt-6 = "workspace 6";
alt-7 = "workspace 7";
alt-8 = "workspace 8";
alt-9 = "workspace 9";
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
alt-shift-1 = "move-node-to-workspace 1";
alt-shift-2 = "move-node-to-workspace 2";
alt-shift-3 = "move-node-to-workspace 3";
alt-shift-4 = "move-node-to-workspace 4";
alt-shift-5 = "move-node-to-workspace 5";
alt-shift-6 = "move-node-to-workspace 6";
alt-shift-7 = "move-node-to-workspace 7";
alt-shift-8 = "move-node-to-workspace 8";
alt-shift-9 = "move-node-to-workspace 9";
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
alt-tab = "workspace-back-and-forth";
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = "mode service";
};
### Service mode (from default config, with default keybindings)
mode.service.binding = {
esc = ["reload-config" "mode main"];
r = ["flatten-workspace-tree" "mode main"]; # reset layout
f = ["layout floating tiling" "mode main"]; # Toggle between floating and tiling layout
backspace = ["close-all-windows-but-current" "mode main"];
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
#s = ["layout sticky tiling", "mode main"]
alt-shift-h = ["join-with left" "mode main"];
alt-shift-j = ["join-with down" "mode main"];
alt-shift-k = ["join-with up" "mode main"];
alt-shift-l = ["join-with right" "mode main"];
## Version 0.16+
# down = "volume down";
# up = "volume up";
# shift-down = ["volume set 0" "mode main"];
};
# on-window-detected = [
# # Use floating mode for Sublime Merge
# {
# "if.app-id" = "com.sublimemerge";
# run = "layout floating";
# }
# ];
};
};
# Auto upgrade nix package and the daemon service.
nix-daemon.enable = true;
skhd = {
enable = true;
enable = false;
skhdConfig = (builtins.readFile ./config/skhdrc);
};
yabai = {
enable = false;
extraConfig = (builtins.readFile ./config/yabairc);
};
};
system.stateVersion = 5;
}

View File

@ -1,8 +0,0 @@
{ user, config, pkgs, ... }:
let
xdg_configHome = "${config.users.users.${user}.home}/.config";
xdg_dataHome = "${config.users.users.${user}.home}/.local/share";
xdg_stateHome = "${config.users.users.${user}.home}/.local/state";
in
{ }

View File

@ -1,10 +1,4 @@
{ config, pkgs, lib, home-manager, ... }:
let
user = "dekker1";
sharedFiles = import ../shared/files.nix { inherit config pkgs; };
additionalFiles = import ./files.nix { inherit user config pkgs; };
in
{ email, name, pkgs, sshSignKey, user, ... }:
{
# It me
users.users.${user} = {
@ -17,41 +11,50 @@ in
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
cleanup = "zap";
};
casks = pkgs.callPackage ./casks.nix { };
brews = [
"biber@2.17"
"openssl" # Required by cargo-update (`LDFLAGS="-L/usr/local/opt/openssl@3/lib" CPPFLAGS="-I/usr/local/opt/openssl@3/include" cargo install cargo-update`)
# MiniZinc solvers
"dekker1/minizinc/choco"
"dekker1/minizinc/flatzingo"
"dekker1/minizinc/geas"
"dekker1/minizinc/jacop"
"dekker1/minizinc/fzn-oscar-cbls"
"dekker1/minizinc/fzn-picat"
"dekker1/minizinc/pumpkin"
"dekker1/minizinc/yuck"
"scip"
];
taps = builtins.attrNames config.nix-homebrew.taps;
};
taps = [
"dekker1/minizinc"
];
# These app IDs are from using the mas CLI app
# mas = mac app store
# https://github.com/mas-cli/mas
#
# $ nix shell nixpkgs#mas
# $ mas search <app name>
#
homebrew.masApps = {
"1Password for Safari" = 1569813296;
"Baking Soda" = 1601151613;
"Keynote" = 409183694;
"Microsoft Excel" = 462058435;
"Microsoft Word" = 462054704;
"Numbers" = 409203825;
"Pages" = 409201541;
"Pixelmator Pro" = 1289583905;
"Qantas" = 1468230799;
"Slack" = 803453959;
"Textual IRC Client" = 1262957439;
"The Unarchiver" = 425424353;
"Userscripts-Mac-App" = 1463298887;
"Vinegar" = 1591303229;
"WhatsApp" = 1147396723;
"Wipr" = 1320666476;
# These app IDs are from using the mas CLI app
# mas = mac app store
# https://github.com/mas-cli/mas
#
# $ nix shell nixpkgs#mas
# $ mas search <app name>
#
masApps = {
"1Password for Safari" = 1569813296;
"Baking Soda" = 1601151613;
"Keynote" = 409183694;
"Numbers" = 409203825;
"Pages" = 409201541;
"Pixelmator Pro" = 1289583905;
"Qantas" = 1468230799;
"Textual IRC Client" = 1262957439;
"The Unarchiver" = 425424353;
"Userscripts-Mac-App" = 1463298887;
"Vinegar" = 1591303229;
"Wipr" = 1320666476;
};
};
# Enable home-manager
@ -59,24 +62,16 @@ in
useGlobalPkgs = true;
users.${user} = { pkgs, config, lib, ... }: {
home.enableNixpkgsReleaseCheck = false;
home.packages = pkgs.callPackage ./packages.nix { };
home.file = lib.mkMerge [
sharedFiles
additionalFiles
];
home.stateVersion = "21.11";
programs = {
programs = lib.attrsets.recursiveUpdate (import ../shared/home-manager.nix {
inherit config email lib name pkgs sshSignKey user;
}) {
# MacOS specific home-manager program settings
git.extraConfig.gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
skim.enable = true;
ssh.matchBlocks = {
"*" = {
extraOptions = {
"UseKeychain" = "yes";
};
};
};
} // import ../shared/home-manager.nix {
inherit config pkgs lib;
ssh.matchBlocks."*".extraOptions."UseKeychain" = "yes";
};
};
};

View File

@ -1,8 +0,0 @@
{ pkgs }:
with pkgs;
let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in
shared-packages ++ [
# Encryption and security tools
pinentry_mac
]

230
flake.lock generated
View File

@ -1,22 +1,5 @@
{
"nodes": {
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1716195221,
"narHash": "sha256-u+zjC7efKD3gBD9aKXsUTEhRhBQhYlP+KPFp1QbsgOo=",
"owner": "Homebrew",
"repo": "brew",
"rev": "e0bc557e7b991cb23583679e1cf1c8a92b793aeb",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "4.3.1",
"repo": "brew",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@ -24,54 +7,20 @@
]
},
"locked": {
"lastModified": 1717976995,
"narHash": "sha256-u3HBinyIyUvL1+N816bODpJmSQdgn0Mbb8BprFw7kqo=",
"lastModified": 1736820923,
"narHash": "sha256-SDuKLOWAh8VJRXlNWQn9QE99bjeEUAAbYXqrKGbsiyk=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "315aa649ba307704db0b16c92f097a08a65ec955",
"rev": "944c2b181792ae7ae6b20c0df3f44879c11706c9",
"type": "github"
},
"original": {
"owner": "LnL7",
"ref": "master",
"ref": "nix-darwin-24.11",
"repo": "nix-darwin",
"type": "github"
}
},
"dgfl-tap": {
"flake": false,
"locked": {
"lastModified": 1713015168,
"narHash": "sha256-zQwGwu6PUL7Gv7PeVSQU1Edqji2jSGkZchJ5/03IrlQ=",
"owner": "dgfl-gh",
"repo": "homebrew-taps",
"rev": "e7b966a234cff599e79a5313939cfcfd390537e1",
"type": "github"
},
"original": {
"owner": "dgfl-gh",
"repo": "homebrew-taps",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -79,164 +28,32 @@
]
},
"locked": {
"lastModified": 1717476296,
"narHash": "sha256-ScHe38Tr+TxGURC17kby4mIIxOG3aJvZWXzPM79UnEk=",
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "095ef64aa3b2ab4a4f1bf07f29997e21e3a5576a",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"homebrew-bundle": {
"flake": false,
"locked": {
"lastModified": 1718066211,
"narHash": "sha256-DHWb3PY7ceWBgxGebgFeK3gGiZP0/a614H097UhZ9tM=",
"owner": "homebrew",
"repo": "homebrew-bundle",
"rev": "ba4203d86f41b2db5aa0395d04e9e83952918ff3",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-bundle",
"type": "github"
}
},
"homebrew-cask": {
"flake": false,
"locked": {
"lastModified": 1718081617,
"narHash": "sha256-0X4yXFa/hKIg/vg34ArQBTF/mJCo9jDABDpstm0XXjA=",
"owner": "homebrew",
"repo": "homebrew-cask",
"rev": "172f4b6f06d0415fb38e40a5a27a349ec847a6e3",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-cask",
"type": "github"
}
},
"homebrew-cask-fonts": {
"flake": false,
"locked": {
"lastModified": 1715830477,
"narHash": "sha256-AjZYkbKvpRIHUwSimOebOQ/AuwP7Z3eIKFTyJaHyG1g=",
"owner": "homebrew",
"repo": "homebrew-cask-fonts",
"rev": "0ed20f35d21ebc3f4f829689b101078718ad5ce1",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-cask-fonts",
"type": "github"
}
},
"homebrew-core": {
"flake": false,
"locked": {
"lastModified": 1718082926,
"narHash": "sha256-S28cBotCsTzIvLcgbXznqUNT+F4FrtgqJeASqEOenbo=",
"owner": "homebrew",
"repo": "homebrew-core",
"rev": "e3e22345b47943a9a9d138166354e2376308c683",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-core",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1716329735,
"narHash": "sha256-ap51w+VqG21vuzyQ04WrhI2YbWHd3UGz0e7dc/QQmoA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "eac4f25028c1975a939c8f8fba95c12f8a25e01c",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src",
"flake-utils": "flake-utils",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1716838497,
"narHash": "sha256-tkceXNn87z+uC08gvQCl7olSCS782EWdflgq0FkSKiw=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "31e9c8105a3ffdc03829c8c195d385500760d309",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687274257,
"narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=",
"path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source",
"rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1716330097,
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1717943341,
"narHash": "sha256-yxWsqI5xJD3CxLsxUdwO0j6I3w9tWL7OTPX+an34NeE=",
"lastModified": 1736780541,
"narHash": "sha256-6AwU5WC45Ww5q5qVR/AzKS4CeZzgOhclBKi5H7zrCnI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d7a9684369629451f055bdef150053e3ba02c142",
"rev": "31206f5a1d081808b14aef7b48f7c214d902b8c0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-23.11-darwin",
"ref": "nixpkgs-24.11-darwin",
"repo": "nixpkgs",
"type": "github"
}
@ -244,29 +61,8 @@
"root": {
"inputs": {
"darwin": "darwin",
"dgfl-tap": "dgfl-tap",
"home-manager": "home-manager",
"homebrew-bundle": "homebrew-bundle",
"homebrew-cask": "homebrew-cask",
"homebrew-cask-fonts": "homebrew-cask-fonts",
"homebrew-core": "homebrew-core",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs_3"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},

116
flake.nix
View File

@ -2,107 +2,53 @@
description = "Dekker1's home manager configuation";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-24.11-darwin";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:LnL7/nix-darwin/master";
url = "github:LnL7/nix-darwin/nix-darwin-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew = {
url = "github:zhaofengli/nix-homebrew";
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-cask-fonts = {
url = "github:homebrew/homebrew-cask-fonts";
flake = false;
};
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
dgfl-tap = {
url = "github:dgfl-gh/homebrew-taps";
flake = false;
};
};
outputs =
{ self
, darwin
{ darwin
, home-manager
, homebrew-bundle
, homebrew-cask
, homebrew-cask-fonts
, homebrew-core
, dgfl-tap
, nix-homebrew
, nixpkgs
} @inputs:
, ...
} @ inputs:
let
user = "dekker1";
# Systems that can be used
linuxSystems = [ "x86_64-linux" "aarch64-linux" ];
darwinSystems = [ "aarch64-darwin" ];
forAllLinuxSystems = f: nixpkgs.lib.genAttrs linuxSystems (system: f system);
forAllDarwinSystems = f: nixpkgs.lib.genAttrs darwinSystems (system: f system);
forAllSystems = f: nixpkgs.lib.genAttrs (linuxSystems ++ darwinSystems) (system: f system);
devShell = system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = with pkgs; mkShell {
nativeBuildInputs = with pkgs; [ bashInteractive git ];
shellHook = with pkgs; ''
'';
};
};
darwinSystems = [ "aarch64-darwin" "x86_64-darwin" ];
# Arguments that are passed into the system configuration
name = "Jip J. Dekker";
email = "jip@dekker.one";
sshSignKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCC0liW47USr/Ic1rJ52V4eE07y42VG9Ols1zYBrPlc";
user = "dekker1";
# Special arguments that are passed into each system configuration
specialArgs = inputs // { inherit email name sshSignKey user; };
in
{
devShells = forAllSystems devShell;
darwinConfigurations = let user = "dekker1"; in {
macos = darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = inputs;
modules = [
nix-homebrew.darwinModules.nix-homebrew
home-manager.darwinModules.home-manager
{
nix-homebrew = {
enable = true;
user = "${user}";
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
"homebrew/homebrew-cask-fonts" = homebrew-cask-fonts;
"homebrew/homebrew-bundle" = homebrew-bundle;
"dgfl-gh/homebrew-taps" = dgfl-tap;
};
mutableTaps = false;
autoMigrate = true;
};
}
./darwin
];
};
};
darwinConfigurations = nixpkgs.lib.genAttrs darwinSystems (system:
darwin.lib.darwinSystem {
inherit system specialArgs;
modules = [
home-manager.darwinModules.home-manager
./darwin
];
}
);
nixosConfigurations = nixpkgs.lib.genAttrs linuxSystems (system: nixpkgs.lib.nixosSystem {
system = system;
specialArgs = inputs;
inherit system specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = import ./nixos/home-manager.nix;
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${user} = import ./nixos/home-manager.nix;
};
}
./nixos
];

View File

@ -1,9 +0,0 @@
## Layout
```
.
├── config # Config files not written in Nix
├── default.nix # Defines module, system-level config,
├── files.nix # Non-Nix, static configuration files (now immutable!)
├── home-manager.nix # Defines user programs
├── packages.nix # List of packages to install for NixOS
```

View File

@ -1,9 +1,4 @@
{ config, inputs, pkgs, ... }:
let
user = "dekker1";
keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICwXNVel0w1f4nbmu2iJsqCoeiUsENzTLyhCZjSL+jT+" ];
in
{ pkgs, user, ... }:
{
imports = [
../shared
@ -30,19 +25,14 @@ in
"wheel" # Enable sudo for the user.
];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = keys;
};
# My shell
programs.zsh.enable = true;
fonts.packages = with pkgs; [
];
environment.systemPackages = with pkgs; [
environment.systemPackages = import ../shared/packages.nix { inherit pkgs; } ++ (with pkgs; [
# Linux specific packages
gitAndTools.gitFull
];
]);
system.stateVersion = "21.05"; # Don't change this
fonts.packages = import ../shared/fonts.nix { inherit pkgs; };
system.stateVersion = "21.05";
}

View File

@ -1,9 +0,0 @@
{ user, pkgs, ... }:
let
home = builtins.getEnv "HOME";
xdg_configHome = "${home}/.config";
xdg_dataHome = "${home}/.local/share";
xdg_stateHome = "${home}/.local/state";
in
{ }

View File

@ -1,26 +1,18 @@
{ config, pkgs, lib, ... }:
let
user = "dekker1";
xdg_configHome = "/home/${user}/.config";
shared-programs = import ../shared/home-manager.nix { inherit config pkgs lib; };
shared-files = import ../shared/files.nix { inherit config pkgs; };
in
{ config, email, lib, name, pkgs, sshSignKey, user, ... }:
{
home = {
enableNixpkgsReleaseCheck = false;
username = "${user}";
homeDirectory = "/home/${user}";
packages = // pkgs.callPackage ./packages.nix { };
file = shared-files // import ./files.nix { inherit user; };
stateVersion = "21.05";
};
programs = {
programs = lib.attrsets.recursiveUpdate (import ../shared/home-manager.nix {
inherit config email lib name pkgs sshSignKey user;
}) {
firefox = {
enable = true;
package = pkgs.firefox-bin;
};
} // shared-programs;
};
}

View File

@ -1,8 +0,0 @@
{ pkgs }:
with pkgs;
let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in
shared-packages ++ [
# Encryption and security tools
pinentry
]

View File

@ -1,6 +0,0 @@
# Overlays
Files in this directory run automatically as part of each build. Some common ways I've used overlays in the past:
* Applying patches
* Downloading different versions of files (locking to a version or trying a fork)
* Workarounds and stuff I need to run temporarily

View File

@ -1,16 +0,0 @@
## Shared
Much of the code running on MacOS or NixOS is actually found here.
This configuration gets imported by both modules. Some configuration examples include `git`, `zsh`, `vim`, and `tmux`.
## Layout
```
.
├── config # Config files not written in Nix
├── cachix # Defines cachix, a global cache for builds
├── default.nix # Defines how we import overlays
├── files.nix # Non-Nix, static configuration files (now immutable!)
├── home-manager.nix # The goods; most all shared config lives here
├── packages.nix # List of packages to share
```

View File

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ ... }:
{
nix.settings = {
substituters = [

View File

@ -1,46 +0,0 @@
# vim:ft=kitty
## name: Night Owl
## author: Luke Glazebrook <lukeglazebrook@hey.com>
## license: MIT
foreground #d6deeb
background #011627
selection_foreground none
selection_background #1d3b53
#: Cursor colors
cursor #80a4c2
cursor_text_color background
#: The basic 16 colors
#: black
color0 #011627
color8 #575656
#: red
color1 #ef5350
color9 #ef5350
#: green
color2 #22da6e
color10 #22da6e
#: yellow
color3 #addb67
color11 #ffeb95
#: blue
color4 #82aaff
color12 #82aaff
#: magenta
color5 #c792ea
color13 #c792ea
#: cyan
color6 #21c7a8
color14 #7fdbca
#: white
color7 #ffffff
color15 #ffffff

View File

@ -0,0 +1,64 @@
format = """
[](#a3aed2)\
[ ](bg:#a3aed2 fg:#090c0c)\
[](bg:#769ff0 fg:#a3aed2)\
$directory\
[](fg:#769ff0 bg:#394260)\
$git_branch\
$git_status\
[](fg:#394260 bg:#212736)\
$nodejs\
$rust\
$golang\
$php\
[](fg:#212736 bg:#1d2230)\
$time\
[ ](fg:#1d2230)\
\n$character"""
[directory]
style = "fg:#e3e5e5 bg:#769ff0"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"
[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = " "
"Pictures" = " "
[git_branch]
symbol = ""
style = "bg:#394260"
format = '[[ $symbol $branch ](fg:#769ff0 bg:#394260)]($style)'
[git_status]
style = "bg:#394260"
format = '[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)'
[nodejs]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[rust]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[golang]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[php]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[time]
disabled = false
time_format = "%R" # Hour:Minute Format
style = "bg:#1d2230"
format = '[[  $time ](fg:#a0a9cb bg:#1d2230)]($style)'

View File

@ -1,7 +1,5 @@
{ config, pkgs, ... }:
{ ... }:
{
nixpkgs = {
config = {
allowUnfree = true;
@ -9,14 +7,5 @@
allowInsecure = false;
allowUnsupportedSystem = true;
};
overlays =
# Apply each overlay found in the /overlays directory
let path = ../overlays; in with builtins;
map (n: import (path + ("/" + n)))
(filter
(n: match ".*\\.nix" n != null ||
pathExists (path + ("/" + n + "/default.nix")))
(attrNames (readDir path)));
};
}

View File

@ -1,9 +0,0 @@
{ pkgs, config, ... }:
{
".config/kitty/themes/night-owl.conf" = {
text = builtins.readFile ../shared/config/kitty/night-owl.conf;
};
}

6
shared/fonts.nix Normal file
View File

@ -0,0 +1,6 @@
{ pkgs }:
with pkgs; [
ibm-plex
atkinson-hyperlegible
(nerdfonts.override { fonts = [ "Go-Mono" ]; })
]

View File

@ -1,11 +1,8 @@
{ config, pkgs, lib, ... }:
{ pkgs, email, name, sshSignKey, ... }:
let
name = "Jip J. Dekker";
user = "dekker1";
email = "jip@dekker.one";
in
{
atuin.enable = true;
bat.enable = true;
@ -66,22 +63,35 @@ in
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCC0liW47USr/Ic1rJ52V4eE07y42VG9Ols1zYBrPlc";
gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
user.signingkey = sshSignKey;
};
};
jujutsu = {
enable = true;
settings = {
signing = {
sign-all = true;
backend = "ssh";
key = sshSignKey;
};
user = { inherit email name; };
ui.editor = "zed -w";
};
};
kitty = {
darwinLaunchOptions = [ "--single-instance" ];
enable = true;
font = {
name = "JetBrainsMono Nerd Font";
name = "Berkeley Mono Variable Nerd Font";
size = 14;
};
settings = {
cursor_shape = "underline";
confirm_os_window_close = 0;
};
theme = "GitHub Light";
themeFile = "Catppuccin-Latte";
};
# Shared shell configuration
@ -158,23 +168,10 @@ in
'';
};
# sapling = {
# enable = true;
# userName = "Jip J. Dekker";
# userEmail = "jip@dekker.one";
# extraConfig = {
# ui."ignore.userroot" = "~/.config/git/ignore";
# isl = {
# hasShownGettingStarted = false;
# render-compact = false;
# };
# };
# };
ssh = {
enable = true;
matchBlocks = {
optimisation = {
optimization = {
hostname = "compute.optimisation-2020.cloud.edu.au";
user = "dekker1";
};
@ -191,7 +188,7 @@ in
starship = {
enable = true;
settings = (with builtins; fromTOML (readFile ./config/starship-jetpack.toml)) // {
settings = (with builtins; fromTOML (readFile ./config/starship-tokyo-night.toml)) // {
# Overrides
};
};
@ -201,7 +198,7 @@ in
settings = {
misc.disable = [
"brew_cask"
"brew_formula"
# "brew_formula"
"containers"
"gem"
"node"
@ -215,7 +212,7 @@ in
misc.cleanup = true;
misc.no_retry = true;
pre_commands = {
"Home Manager" = "(cd ~/nix-config/ && nix flake update) && ~/nix-config/bin/build";
"Home Manager" = "(cd ~/nix-config/ && nix flake update) && darwin-rebuild switch --flake ~/nix-config#aarch64-darwin";
};
};
};
@ -239,11 +236,6 @@ in
start = "open";
less = "bat";
ls = "eza";
set-light-theme = "kitty +kitten themes GitHub Dark";
set-dark-theme = "kitty +kitten themes GitHub Light";
brew-backup = "brew bundle dump --global --no-lock --formula --cask --mas --tap --force";
brew-cleanup = "brew bundle cleanup --global --no-lock --force --zap";
brew-restore = "brew bundle install --global --no-lock";
};
sessionVariables = {
# Set default editor
@ -257,9 +249,13 @@ in
# Rust settings
RUSTC_WRAPPER = "sccache";
};
initExtra = "zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'";
historySubstringSearch = {
enable = true;
};
initExtra = ''
# Load Homebrew shell environment
if [[ -f "/opt/homebrew/bin/brew" && -x $(realpath "/opt/homebrew/bin/brew") ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -f "/usr/local/bin/brew" && -x $(realpath "/usr/local/bin/brew") ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
'';
};
}

View File

@ -1,5 +1,4 @@
{ pkgs }:
with pkgs; [
# General packages for development and system management
hut
@ -20,27 +19,32 @@ with pkgs; [
zoxide
# Fonts
go-font
ibm-plex
atkinson-hyperlegible
(nerdfonts.override { fonts = [ "Go-Mono" ]; })
# C(++) development tools
sccache
bison
clang-tools
cmake
flex
llvm
ninja
sccache
# Python development tools
black
poetry
uv
# Rust development tools
rustup
# MiniZinc solvers
gecode
# or-tools
or-tools
# Decision Science tools
clingo
# Nix development tools
nixpkgs-fmt